﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Xunit;
using Genuilder.Tests;

namespace Genuilder.Extensions.Tests
{
	public class LinqToXsdTest
	{
		[Fact]
		public void CanCompileTestProject()
		{
			using(var directory = new TestDirectory().Of(TestData))
			{
				var project = Projects.InDirectory(directory.Path).First();
				var ex = new ExtensibilityFeature();
				ex.AddExtension(new LinqToXsdExtension()
				{
					NamespaceMappings = new List<XmlToClrNamespaceMapping>()
					{
						new XmlToClrNamespaceMapping("http://www.example.com/Address", "{{DefaultNamespace}}.XmlTypes")
					}
				});
				project.InstallFeature(ex);
				project.Save();
				project.Build().AssertBuild();
			}
		}

		string TestData = "../../Data/LinqToXsd/";
	}
}
